package com.main.thread;

/**
 * @author Zhang Guangyong
 * @desacription 测试实现方式建立线程
 * @date 2019年07月10日 10:06
 */
public class RunnableTest implements Runnable {

    private static int count = 10;

    /**
     * When an object implementing interface <code>Runnable</code> is used
     * to create a thread, starting the thread causes the object's
     * <code>run</code> method to be called in that separately executing
     * thread.
     * <p>
     * The general contract of the method <code>run</code> is that it may
     * take any action whatsoever.
     *
     * @see Thread#run()
     */
    @Override
    public void run() {
        System.out.println("实现线程开始");
        while (true) {
            System.out.println("count: " + count);

            if (--count == 0) {
                return;
            }


        }


    }
}
